yjx.config(['$stateProvider', '$urlRouterProvider',
    function ($stateProvider, $urlRouterProvider) {
        // $locationProvider.html5Mode(true);
        //定义默认路由
        $urlRouterProvider.when("", "/");
        //$urlRouterProvider.when("#", "");
        //$urlRouterProvider.otherwise("/index");
        //.state('[一级路由.二级路由...]'), { url:'[链接]', templateUrl:'[引入页面]'}
        $stateProvider.state('index', {
            url: "/",
            templateUrl: "components/home/home.html",
            controller: "WxController",
        });
        /**首页模块 */
        /**使用协议 */
        $stateProvider.state('agreenment', {
            url: '/agreenment',
            templateUrl: 'components/user/agency/disclaimer.html',
        })
        /*banner详情*/
        $stateProvider.state('bannerDetail', {
            url: '/bannerDetail?:id:forwardId:pendingEventId',
            templateUrl: 'components/home/banner/bannerIntro.html',
            params: { id: null, forwardId: null, pendingEventId: null },
        })
        /*我本月佣金*/
        $stateProvider.state('myBrokerage', {
            url: '/myBrokerage',
            templateUrl: 'components/home/brokerage/myBrokerage.html'
        })
        /*我未来可获得佣金*/
        $stateProvider.state('unBrokerage', {
            url: '/unBrokerage',
            templateUrl: 'components/home/brokerage/unBrokerage.html'
        })
        /*机构详情*/
        $stateProvider.state('orgDetail', {
            url: '/orgDetail?:id',
            templateUrl: 'components/home/organization/orgIntro.html',
            params: { id: null }
        })
        $stateProvider.state('orgList', {
            url: '/orgList',
            templateUrl: 'components/home/organization/orgList.html',
        })
        /*课程详情*/
        $stateProvider.state('courseIntro', {
            url: '/courseIntro?id',
            templateUrl: 'components/home/recCourse/courseIntro.html',
            params: { id: null }
        })

        /**产品模块 */
        $stateProvider.state('product', {
            url: "/product?:classId:dimensionId",
            templateUrl: "components/product/product.html",
            params: { classId: null, dimensionId: null }
        });
        $stateProvider.state('productSearch', {
            url: '/productSearch',
            templateUrl: "components/product/productSearch/productSearch.html",
            params: { classId: null }
        })
        /*产品详情*/
        $stateProvider.state('productDetail', {
            url: '/productDetail?:id:forwardId:pendingEventId',
            templateUrl: 'components/product/productDetail/productDetail.html',
            params: { id: null, forwardId: null, pendingEventId: null },
        }).state('productDetail.orderClient', {
            url: '/orderClient?:id:type',
            templateUrl: 'components/product/productDetail/orderClient.html',
            params: { id: null, type: null }
        }).state('productDetail.pdfDetail', {
            url: '/pdfDetail?:pdfUrl',
            templateUrl: 'components/pdfDetail/pdfDetail.html',
            params: { pdfUrl: null },
        })
        $stateProvider.state('reservation', {
            /*预约列表*/
            url: '/reservation?:id',
            templateUrl: 'components/reservation/reservationList.html',
            params: { id: null }
        })
        /**产品计划书 */
        $stateProvider.state('productPlan', {
            url: '/productPlan?:forwardId:customerId:productIds:discountPrice',
            templateUrl: 'components/product/productPlan/productPlan.html',
            params: { forwardId: null, customerId: null, productIds: null, discountPrice: null }
        })
        /*与客户聊天界面*/
        $stateProvider.state('chat', {
            url: '/chat',
            templateUrl: 'components/IM/chat.html',
        })

        /**支持模块 */
        $stateProvider.state('support', {
            url: "/support",
            templateUrl: "components/support/support.html",
        });
        /*获得支持详情*/
        $stateProvider.state('surDetail', {
            url: '/surDetail?:id:forwardId:pendingEventId:customerId',
            templateUrl: 'components/support/detail/supportDetail.html',
            params: { id: null, forwardId: null, pendingEventId: null, customerId: null },
        })

        /**个人中心模块 */
        $stateProvider.state('user', {
            url: '/user',
            templateUrl: 'components/user/my/user.html',
        })
        /*编辑个人信息*/
        $stateProvider.state('profile', {
            url: '/profile',
            templateUrl: 'components/user/profile/profile.html'
        })
        /*我的订单列表*/
        $stateProvider.state('orderList', {
            url: '/orderList',
            templateUrl: 'components/order/orderList.html'
        })

        /**订单详情 */
        $stateProvider.state('orderDetail', {
            url: '/orderDetail?:id',
            templateUrl: 'components/order/orderDetail/orderDetail.html',
            params: ({ id: null })
        }).state('orderDetail.contract', {
            url: '/contract',
            templateUrl: 'components/order/orderDetail/contract.html',
        }).state('orderDetail.coupons', {
            url: '/coupons',
            templateUrl: 'components/order/orderDetail/couponUsed.html',
        })

        /**评论 */
        $stateProvider.state('comment', {
            url: '/commenet?:id',
            templateUrl: 'components/comment/comment.html',
            params: ({ id: null })
        })
        /*客户列表*/
        $stateProvider.state('clientList', {
            url: '/clientList',
            templateUrl: 'components/client/clientList.html'
        }).state('clientList.info', {
            url: '/info',
            templateUrl: 'components/client/clientInfo/clientInfo.html',
        }).state('clientList.info.tag', {
            url: '/tag',
            templateUrl: 'components/client/clientInfo/addTags.html',
        })
        /*客户详情*/
        $stateProvider.state('clientDetail', {
            url: '/clientDetail?:id',
            templateUrl: 'components/client/clientDetail/clientDetail.html',
            params: { id: null }
        }).state('clientDetail.editRelation', {
            url: '/editRelation',
            templateUrl: 'components/client/clientRelationships/editRelation.html'
        }).state('clientDetail.pdfDetail', {
            url: '/pdfDetail',
            templateUrl: 'components/pdfDetail/pdfDetail.html'
        }).state('clientDetail.editInfo', {
            url: '/editInfo',
            templateUrl: 'components/client/clientInfo/clientInfo.html'
        }).state('clientDetail.editInfo.tag', {
            url: '/tag',
            templateUrl: 'components/client/clientInfo/addTags.html',
        }).state('clientDetail.editPlan', {
            url: '/editPlan',
            templateUrl: 'components/client/clientDetail/clientPlan/clientPlan.html',
        }).state('clientDetail.editPlan.selectProduct', {
            url: '/selectProduct',
            templateUrl: 'components/product/productSelect.html'
        })
        /*我的团队*/
        $stateProvider.state('team', {
            url: '/team?:id:teamNo',
            templateUrl: 'components/user/team/team.html',
            params: { id: null, teamNo: null }
        }).state('team.members', {
            url: '/members',
            templateUrl: 'components/user/team/members.html'
        }).state('team.create', {
            url: '/create',
            templateUrl: 'components/user/team/createTeam.html'
        })
        /*待办事项*/
        $stateProvider.state('todo', {
            url: '/todo',
            templateUrl: 'components/user/todo/todo.html'
        })
        /*我要提现*/
        $stateProvider.state('withdraw', {
            url: '/withdraw',
            templateUrl: 'components/user/withdraw/withdraw.html'
        })
        /*消息列表*/
        $stateProvider.state('message', {
            url: '/message',
            templateUrl: 'components/user/message/message.html',
        })
        /*关于我们*/
        $stateProvider.state('about', {
            url: '/about',
            templateUrl: 'components/about/about.html',
        })
        /** 收支情况*/
        $stateProvider.state('account', {
            url: '/account',
            templateUrl: 'components/user/account/account.html'
        })
        /**购物车 */
        $stateProvider.state('shopcart', {
            url: '/shopcart',
            templateUrl: 'components/shopcart/shopcart.html'
        }).state('shopcart.orderPay', {
            /*下订单*/
            url: '/order?:productIds:forwardId:pendingEventId:customerId',
            templateUrl: 'components/order/orderPay/order.html',
            params: ({ productIds: null, forwardId: null, pendingEventId: null, customerId: null })
        }).state('shopcart.orderPay.coupon', {
            /**选择优惠券 */
            url: '/coupon',
            templateUrl: 'components/user/coupon/couponSelect.html',
        }).state('shopcart.orderPay.client', {
            /**选择客户 */
            url: '/client',
            templateUrl: 'components/client/clientSelect.html'
        }).state('shopcart.orderPay.disclaimer', {
            url: '/disclaimer',
            templateUrl: 'components/order/orderPay/disclaimer.html',
        })
        /**在线问答 */
        $stateProvider.state('ask', {
            url: '/ask',
            templateUrl: 'components/user/ask/askList.html'
        }).state('ask.detail', {
            url: '/detail',
            templateUrl: 'components/user/ask/askDetail.html'
        })
        $stateProvider.state('toAsk', {
            url: '/toAsk',
            templateUrl: 'components/user/ask/toAsk.html'
        })
        /**我的权益 */
        $stateProvider.state('coupon', {
            url: '/coupon',
            templateUrl: 'components/user/coupon/couponList.html'
        })
        $stateProvider.state('couponDetail', {
            url: '/couponDetail',
            templateUrl: 'components/user/coupon/couponDetail/couponDetail.html'
        })


        /**其他测试相关 */
        $stateProvider.state('details', {
            url: '/details',
            templateUrl: 'components/test/details.html',
            reloadOnSearch: false
        });
        $stateProvider.state('testdetail3', {
            url: '/testdetail3',
            views: {
                'vWindow': { templateUrl: "components/common/layout/appDetail.html" },//新窗口路由
                'detailBody@testdetail3': { templateUrl: 'components/test/detail3.html', }//模板内容会被安插在父路由testdetail3模板中视图名为detailBody下 新窗口内容detailBody：uiview名称；
            }
        });
        $stateProvider.state('pay', {
            url: '/pay',
            templateUrl: "components/pay/payform.html",//新窗口路由
        });

        $stateProvider.state('notFound', {
            url: '/notFound',
            templateUrl: "404.html",
        })

        //去#号 首页需加<base href="/">
        //手机端不需要避免引起刷新找不到页面(bug未知) $locationProvider.html5Mode(true);
    }]);
